/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.dandsoft.mavrep.web;

/**
 *
 * @author fin
 */
public final class ViewUtils {

    private ViewUtils() {
    }


    public static String getView(Class controllerClass, Enum viewName) {
        return controllerClass.getName() + "." + viewName.toString();
    }

    public static String removeSuffix(String str, String suffix) {
        int index = -1;
        int lastIndex = -1;
        while((lastIndex = str.indexOf(suffix, lastIndex)) != -1) {
            index = lastIndex;
        }
        return index == -1 ? str : str.substring(0, index);
    }
}
